#include <iostream>
#include <string>
using namespace std;

int main(){
	int p1,p2,p3;
	cin >> p1 >> p2 >> p3;
	string str0,str1;
	cin >> str0;
	char ch0,ch1;
	int sz = str0.size();
	ch0 = str0[0];
	for(int i = 0;i < sz - 1;i++){
		ch1 = str0[i + 1];
		str1 += ch0;
		if(ch1 != '-'){
			ch0 = ch1;
		}
		else{
			ch1 = str0[++i + 1];
			if(ch1 - ch0 <= 0||ch1 - ch0 > 26||ch1 == '-'||ch0 == '-'){
				str1 += "-";
				ch0 = ch1;
				continue;
			}
			if(ch1 - ch0 == 1){
				ch0 = ch1;
				continue;
			}
			if(p1 == 1||(ch0 >= '0'&&ch0 <= '9'&&p1 != 3)){
				if(p3 == 1){
					for(int t = ch1 - ch0 - 1;t;t--){
					for(int k = 1;k <= p2;k++){
						str1 += (char)(ch1 - t);
					}
				}
				}
				else if(p3 == 2){
					for(int t = ch1 - ch0 - 1;t;t--){
					for(int k = 1;k <= p2;k++){
						str1 += (char)(ch0 + t);
					}
				}
				}
			}
			else if(p1 == 2){
				if(p3 == 1){
					for(int t = ch1 - ch0 - 1;t;t--){
					for(int k = 1;k <= p2;k++){
						str1 += (char)(ch1 - t - 32);
					}
				}
				}
				else if(p3 == 2){
					for(int t = ch1 - ch0 - 1;t;t--){
					for(int k = 1;k <= p2;k++){
						str1 += (char)(ch0 + t - 32);
					}
				}
				}
			}
			else if(p1 == 3){
				for(int t = ch1 - ch0 - 1;t;t--){
				for(int k = 1;k <= p2;k++){
					str1 += "*";
				}
			}
			}
			ch0 = ch1;
		}
	}
	str1 += ch0;
	cout << str1 << endl;
	return 0;
}
